package br.com.comanda.webservice.resources;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import br.com.comanda.webservice.business.ProductBusiness;
import br.com.comanda.webservice.model.Product;

@Path("/products")
public class ProductResources {

	private final ProductBusiness productBusiness = new ProductBusiness();

	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public List<Product> getProducts() {
		return this.productBusiness.findAll();
	}

	@Path("{id}")
	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public Product getProduct(@PathParam("id") Long id) {
		return this.productBusiness.findById(id);
	}

	public List<Product> getProducts2() {
		return null;
	}

}
